package com.bt.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bt.mapper.DtsRegionMapper;
import com.bt.pojo.DtsRegion;
import com.bt.service.DtsRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wbt
 * @version v1.0
 * @project shop_manage
 * @data 2022/9/24 19:28
 **/
@Service
public class DtsRegionServiceImpl implements DtsRegionService {
    @Autowired
    private DtsRegionMapper dtsRegionMapper;
    @Override
    public IPage<DtsRegion> findRegionByPage(Integer page, Integer limit, String name, String code) {
        return dtsRegionMapper.selectPage(new Page<DtsRegion>(page,limit),new QueryWrapper<DtsRegion>().eq(name!=null,"name",name).eq(code!=null,"code",code));
    }
}
